var mongoose = require('../common/db');
var commentSchema = new mongoose.Schema({
    movie_id: String,
    username: String,
    context: String,
    check: Boolean
});

commentSchema.statics.findByMovieId = function (m_id, callBack) {
    this.find({movie_id: m_id, check:true}, callBack);
};

commentSchema.statics.findAll = function (callBack) {
    this.find({}, callBack);
};

var commentModel = mongoose.model('comment', commentSchema);

module.exports = commentModel;